<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>AIL - Cookies</title>
  <link rel="icon" href="{{ url_for('static', filename='image/ail-icon.png') }}">

  <!-- Core CSS -->
  <link href="{{ url_for('static', filename='css/bootstrap4.min.css') }}" rel="stylesheet">
	<link href="{{ url_for('static', filename='css/font-awesome.min.css') }}" rel="stylesheet">
  <link href="{{ url_for('static', filename='css/dataTables.bootstrap.min.css') }}" rel="stylesheet">

  <script src="{{ url_for('static', filename='js/jquery.js')}}"></script>
  <script src="{{ url_for('static', filename='js/bootstrap4.min.js')}}"></script>
  <script src="{{ url_for('static', filename='js/jquery.dataTables.min.js')}}"></script>
	<script src="{{ url_for('static', filename='js/dataTables.bootstrap.min.js')}}"></script>
</head>
<body>

  {% include 'nav_bar.html' %}

  <div class="container-fluid">
		<div class="row">

			{% include 'crawler/menu_sidebar.html' %}

      <div class="col-12 col-lg-10" id="core_content">

        <div class="card mb-3 mt-1">
          <div class="card-header text-white bg-dark">
            <h5 class="card-title"><i class="fas fa-cookie-bite"></i> Your Cookiejar</h5>
          </div>
          <div class="card-body">
            {% with all_cookiejar=user_cookiejar, table_id='table_user'%}
              {% include 'crawler/crawler_splash/table_cookiejar.html' %}
            {% endwith %}
          </div>
        </div>

        <div class="card mb-3 mt-1">
          <div class="card-header text-white bg-dark">
            <h5 class="card-title"><i class="fas fa-cookie-bite"></i> Organisation Cookiejar</h5>
          </div>
          <div class="card-body">
            {% with all_cookiejar=org_cookiejar, table_id='table_org'%}
              {% include 'crawler/crawler_splash/table_cookiejar.html' %}
            {% endwith %}
          </div>
        </div>

        <div class="card mb-3 mt-1">
          <div class="card-header text-white bg-dark">
            <h5 class="card-title"><i class="fas fa-cookie-bite"></i> Global Cookiejar</h5>
          </div>
          <div class="card-body">
            {% with all_cookiejar=global_cookiejar, table_id='table_global'%}
              {% include 'crawler/crawler_splash/table_cookiejar.html' %}
            {% endwith %}
          </div>
        </div>

        <a class="btn btn-info my-4" href="{{url_for('crawler_splash.crawler_cookiejar_add')}}">
          <i class="fas fa-plus-circle ml-auto"></i>
          Create Cookiejar
        </a>

      </div>
		</div>
	</div>

<script>
$(document).ready(function(){
  $("#page-crawler").addClass("active");
	$("#nav_cookiejar_all").addClass("active");
	$("#nav_title_cookiejar").removeClass("text-muted");

  $('#table_user').DataTable({
        "aLengthMenu": [[5, 10, 15, -1], [5, 10, 15, "All"]],
        "iDisplayLength": 10,
        "order": [[ 0, "desc" ]]
  });
  $('#table_org').DataTable({
        "aLengthMenu": [[5, 10, 15, -1], [5, 10, 15, "All"]],
        "iDisplayLength": 10,
        "order": [[ 0, "desc" ]]
  });
  $('#table_global').DataTable({
        "aLengthMenu": [[5, 10, 15, -1], [5, 10, 15, "All"]],
        "iDisplayLength": 10,
        "order": [[ 0, "desc" ]]
  });


});

function toggle_sidebar(){
	if($('#nav_menu').is(':visible')){
		$('#nav_menu').hide();
		$('#side_menu').removeClass('border-right')
		$('#side_menu').removeClass('col-lg-2')
		$('#core_content').removeClass('col-lg-10')
	}else{
		$('#nav_menu').show();
		$('#side_menu').addClass('border-right')
		$('#side_menu').addClass('col-lg-2')
		$('#core_content').addClass('col-lg-10')
	}
}
</script>

</body>
</html>
